package com.alex;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Properties;

@Component
public class MainTaskWithAnnotation {

    @Value("${task1.name}")
    String name;

    @Autowired
    Properties dbConfig;

    // @Value("#{dbConfig.util.name}")
    // String utilName;

    @PostConstruct
    public void start() {
        System.out.println(name);

        System.out.println();

        // System.out.println(utilName);
        System.out.println(dbConfig.getProperty("util.name"));
    }
}
